# Copyright (c) 2025, Huawei Technologies.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# ==============================================================================

# 语言切换
ZH_CN = "zh-CN"
EN = "en"
language = {
    ZH_CN: {
        'typeError': '文件类型错误',
        'searchTypeError': '搜索类型错误',
        'nodeInfoError': '查询参数nodeInfo及其子项必须存在且必须为字典',
        'metaDataError': '查询参数“metaData”及其子项必须存在且必须为字典',
        'dbInitError': '数据库初始化失败',
        'loadConfigError': '加载图配置信息失败',
        'rankStepNullError': 'rank或step或micro_step为空',
        'loadNodeError': '加载图所有节点列表失败',
        'expandNodeError': '节点展开或收起发生错误',
        'searchNodeError': '节点搜索发生错误',
        'graphTypeError': '图类型错误,仅支持 "NPU" 或 "BENCH"',
        'getNodeInfoError': '获取节点信息失败',
        'taskTypeError': '任务类型不支持',
        'matchNodeError': '匹配节点失败',
        'loadConfigFileError': '读取配置文件失败',
        'matchNodeLinksNullError': '匹配配置文件为空',
        'parameterError': '参数错误',   
        'nodesTypeError': '节点类型不一致, 无法添加匹配关系',
        'taskTypeWrong': 'task类型错误',
        'nodeNotExist': '节点不存在',
        'ioEmptyError': '输入或输出统计误差值为空',
        'outputEmptyError': '输出统计误差值为空，计算精度误差失败',
        'operationFailed': '操作失败：',
        'or': '或',
        'nodeUnmatchError': '节点未匹配，请先匹配节点',
        'deleteMatchNodeFailed': '删除匹配节点失败',
        'noUpdateNodesFound': '未找到可更新的节点',
        'updateNodeAccuracyFailed': '更新节点精度失败',
        'updateDatabaseFailed': '更新数据库失败',
        'updateColorFailed': '更新颜色失败',
        'saveMatchRelationshipFailed': '保存匹配关系失败',
        'selectedNodeCantMatched': '选择的节点不可匹配',
        'loadErrorBySecurityIssue': '文件存在安全问题，读取文件失败',
        'loadConfigFailed': '获取配置信息失败, 请检查目录中第一个文件',
        'debug': '调试侧',
        'bench': '标杆侧',
        'obtainNodesAccuracyFailed': '获取符合精度误差节点失败',
        'notSupportOverflow': '多图模式下不支持溢出检测',
        'obtainNodesOverflowFailed': '获取符合溢出检测节点失败',
        'updatePrecisionFailed': '更新精度误差失败',
        'nodeTypeError': '节点类型错误',
        'readFileFailed': '读取文件失败',
        'parameterEmpty': '参数为空',
        'saveFileFailed': '保存文件失败',
        'dbConncetionNotInit': '数据库链接未初始化',
        'parseJsonFailed': '解析JSON失败',
        'getNodeListFailed': '获取节点列表失败',
        'initGraphJsonFailed': '初始化json图数据失败',
        'colorsNotObject': 'colors 必须是一个对象',
        'colotsEmpty': 'colors 不能为空',
        'illegalColorKey': '非法颜色键: ',
        'colorValuesNotObject': '颜色值必须是对象: ',
        'missingValueField': '缺少 value 字段: ',
        'notArrayOfLength2': 'value 必须是长度为2的数组: ',
        'notArrayConsistNumbers': 'value 数组必须是数字: ',
        'invalidValueRange': 'value 区间无效（左 >= 右）: ',
        'unsupportedValue': '不支持的 value 字符串值: ',
        'valueTypeError': 'value 必须是数字数组或字符串: ',
        'descriptionError': 'description 包含恶意内容或格式错误: ',
        'circularReferenceError1': '检测到循环引用：节点 ',
        'circularReferenceError2': ' 已存在于路径中',
        'invalidTag': '无效标签: ',
        'pathMayNotInSecureDirectory': '该路径可能不在安全目录内',
        'serverError': '服务异常，请稍后重试'
    },
    EN: {
        'typeError': 'File type error',
        'searchTypeError': 'Search type error',
        'nodeInfoError': 'The query parameter nodeInfo and its sub-items must exist and must be a dictionary.',
        'metaDataError': 'The query parameter “metaData” and its sub-items must exist and must be a dictionary.',
        'dbInitError': 'Database initialization failed',
        'loadConfigError': 'load graph config info failed',
        'rankStepNullError': 'rank or step or micro_step is null',
        'loadNodeError': 'load graph all node list failed',
        'expandNodeError': 'node expand or collapse error',
        'searchNodeError': 'node search error',
        'graphTypeError': 'graph type error, only support "NPU" or "BENCH"',
        'getNodeInfoError': 'get node info failed',
        'taskTypeError': 'task type not support',
        'matchNodeError': 'match node failed',
        'loadConfigFileError': 'load config file failed',
        'parameterError': 'Parameter Error',
        'nodesTypeError': 'Node types are inconsistent; matching relationships cannot be added.',
        'taskTypeWrong': 'Task type error',
        'nodeNotExist': 'Node does not exist',
        'ioEmptyError': 'The input or output statistical error value is empty.',
        'outputEmptyError': 'The output statistical error value is empty, and the calculation precision error failed.',
        'operationFailed': 'Operation failed: ',
        'or': 'or',
        'nodeUnmatchError': 'Node not matched. Please match the node first.',
        'deleteMatchNodeFailed': 'Failed to delete matching node',
        'noUpdateNodesFound': 'No nodes found to update.',
        'updateNodeAccuracyFailed': 'Failed to update node accuracy',
        'updateDatabaseFailed': 'Failed to update the database',
        'updateColorFailed': 'Color update failed',
        'saveMatchRelationshipFailed': 'Failed to save matching relationship',
        'selectedNodeCantMatched': 'The selected node cannot be matched.',
        'loadErrorBySecurityIssue': 'The file has security issues, and reading the file failed.',
        'loadConfigFailed': 'Failed to retrieve configuration information. Please check the first file in directory.',
        'debug': 'Debug',
        'bench': 'Bench',
        'expandOrCollapseError': 'An error occurred while expanding or collapsing the node.',
        'obtainNodesAccuracyFailed': 'Failed to obtain nodes meeting accuracy error requirements',
        'notSupportOverflow': 'Overflow detection is not supported in multi-image mode.',
        'obtainNodesOverflowFailed': 'Failed to obtain overflow detection node',
        'updatePrecisionFailed': 'Update precision error failure',
        'nodeTypeError': 'Node type error',
        'readFileFailed': 'Failed to read file',
        'parameterEmpty': 'The parameter is empty.',
        'saveFileFailed': 'Failed to save file',
        'dbConncetionNotInit': 'database connection not init',
        'parseJsonFailed': 'Failed to parse JSON',
        'getNodeListFailed': 'Failed to get node list',
        'initGraphJsonFailed': 'initlize graph json failed',
        'colorsNotObject': 'Colors must be an object',
        'colotsEmpty': 'Colors cannot be empty',
        'illegalColorKey': 'Illegal color key: ',
        'colorValuesNotObject': 'Color values must be objects: ',
        'missingValueField': 'Missing value field: ',
        'notArrayOfLength2': 'The value must be an array of length 2: ',
        'notArrayConsistNumbers': 'Value array must consist of numbers: ',
        'invalidValueRange': 'Invalid value range (left >= right): ',
        'unsupportedValue': 'Unsupported value string values: ',
        'valueTypeError': 'Value must be a numeric array or string: ',
        'descriptionError': 'Description contains malicious content or formatting errors: ',
        'circularReferenceError1': 'Detected circular reference: node ',
        'circularReferenceError2': ' already exists in the path',
        'invalidTag': 'Invalid tag: ',
        'pathMayNotInSecureDirectory': 'The path may not be within a secure directory',
        'serverError': 'server error, please try again later'
    }
}
